<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<script type="text/javascript">
//自动有效日期
$(document).on('afterchange.bjui.datepicker', '.j_custom_issuedate', function(e, data) {
    var pattern = 'yyyy-MM-dd'
    var start   = end = data.value
    var $end    = $(this).closest('tr').find('.j_custom_indate')
    
    if ($end.length) {
        end.setFullYear(start.getFullYear() + 10)
        end.setDate(start.getDate() - 1)
        $end.val(end.formatDate(pattern))
    }
})

//删除回调
$('#tabledit1').on('afterdelete.bjui.tabledit', function(e) {
    var $tbody = $(e.relatedTarget)
    
    console.log('你删除了一条数据，还有['+ $tbody.find('> tr').length +']条数据！')
})
</script>
<div class="bjui-pageHeader">
            <button type="button" class="btn-green" data-toggle="tableditadd" data-target="#tabledit1" data-num="1" data-icon="plus">添加编辑行</button>&nbsp;
</div>
<div class="bjui-pageContent tableContent">
    <form action="${ctx}/management/menu/func/saveAll.do" id="j_custom_form" class="pageForm" data-toggle="validate" method="post">
        <table id="tabledit1" class="table table-bordered table-hover table-striped table-top" data-toggle="tabledit" data-initnum="0" data-action="${ctx}/management/menu/func/saveOrUpdate.do" data-single-noindex="true">
           <thead>
   	  		<tr data-idname="No">
                   <th title="N"><input type="text" name="intID"  readonly="readonly"  size="5"></th>
                   <th title="菜单ID"><input type="text" name="menuId" data-rule="required" value="${menuId}" readonly="readonly" size="15"></th>
                   <th title="功能名称"><input type="text" name="funcName" data-rule="required"  size="15"></th>
                   <th title="功能编码"><input type="text" name="funcCode" data-rule="required"  size="15"></th>
                    <th title="备注"><textarea name="remark" data-toggle="autoheight" rows="1" ></textarea></th>
                    <th title="操作"  width="100"> 
                        <a href="${ctx}/management/menu/func/deleteNew.do" class="btn btn-red row-del" data-confirm-msg="确定要删除该行信息吗？">删</a>
                    </th>
   			</tr>
    	</thead>
            <tbody>
            	<c:forEach var="list" items="${objList}">
                <tr data-id="${list.intID}">
                    <td>${list.intID}</td>
                    <td>${list.menuId}</td>
                    <td>${list.funcName}</td>
                    <td>${list.funcCode}</td>
                     <td>${list.remark}</td>
                    <td data-noedit="true">
                        <button type="button" class="btn-green" data-toggle="doedit">编辑</button>
                        <a href="${ctx}/management/menu/func/${list.intID}/delete.do" class="btn btn-red row-del" data-confirm-msg="确定要删除该行信息吗？">删</a>
                    </td>
                </tr>
               </c:forEach>
              
            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">全部保存</button></li>
    </ul>
</div>
